
var id;

var pwd;

window.onload=function (){
    get()
}
function get(){
    axios.get("user/getLoginUser").then(resp=>{
      var info=resp.data
      id=info.id
       pwd=info.pwd
    }).then(resp=>{
   var   info=  resp.data
        if (info === "noland") {
            location.href = "/login.html?errorInfo=noland";
        }
    })
}
function update(){
    if (pwd== $("pwd").value){
        if (($("pdw1").value==$("pwd2").value)){
            axios.get("user/updateUserPwd",{
                params:{
                    id:id,
                    pwd:$("pwd2").value
                }
            }).then(resp=>{
              var info= resp.data
                if (info=="ok"){
                    $("pwdDiv").style.visibility="visible"
                    $("errorSpan").innerHTML=""
                }
            })
        }
    }else {
        $("errorSpan").innerHTML="密码不正确"
    }
}

function sure(){
    $("pwdDiv").style.visibility="hidden"
}